Merge pull request #354 from Oloodi/345-develop-advanced-seed-data-generation-for-mobile-app-demonstrations
345 develop advanced seed data generation for mobile app demonstrations
This commit is contained in:
@@ -31,10 +31,10 @@
|
||||
"client_type": 3
|
||||
},
|
||||
{
|
||||
"client_id": "933560802882-dppsapp5i3lsfrlm1mhob2s21peofg1t.apps.googleusercontent.com",
|
||||
"client_id": "933560802882-29olj9ku64jbe9h7flinha6hbi8qrluh.apps.googleusercontent.com",
|
||||
"client_type": 2,
|
||||
"ios_info": {
|
||||
"bundle_id": "com.krow.app.staff.dev"
|
||||
"bundle_id": "com.krowwithus.staff"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -67,10 +67,10 @@
|
||||
"client_type": 3
|
||||
},
|
||||
{
|
||||
"client_id": "933560802882-dppsapp5i3lsfrlm1mhob2s21peofg1t.apps.googleusercontent.com",
|
||||
"client_id": "933560802882-29olj9ku64jbe9h7flinha6hbi8qrluh.apps.googleusercontent.com",
|
||||
"client_type": 2,
|
||||
"ios_info": {
|
||||
"bundle_id": "com.krow.app.staff.dev"
|
||||
"bundle_id": "com.krowwithus.staff"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -86,47 +86,11 @@
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "933560802882-grp98a1v7amflnnup68vh01tj06eaem1.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyDBYhflhK6DThKnS7RM-9raKdvyKzLUjY4"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "933560802882-grp98a1v7amflnnup68vh01tj06eaem1.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
},
|
||||
{
|
||||
"client_id": "933560802882-dppsapp5i3lsfrlm1mhob2s21peofg1t.apps.googleusercontent.com",
|
||||
"client_type": 2,
|
||||
"ios_info": {
|
||||
"bundle_id": "com.krow.app.staff.dev"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:933560802882:android:1ae05d85c865f77c7757db",
|
||||
"android_client_info": {
|
||||
"package_name": "com.krowwithus.staff"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "933560802882-ikdfv3o5f47g36qqgvfq55o4m19n7gk4.apps.googleusercontent.com",
|
||||
"client_id": "933560802882-fbqg2icq24bmci3f84evjrbth5huh87f.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.krowwithus.staff",
|
||||
"certificate_hash": "ac917ae8470ab29f1107c773c6017ff5ea5d102d"
|
||||
"package_name": "com.krowwithus.client",
|
||||
"certificate_hash": "c3efbe1642239c599c16ad04c7fac340902fe280"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -147,10 +111,46 @@
|
||||
"client_type": 3
|
||||
},
|
||||
{
|
||||
"client_id": "933560802882-dppsapp5i3lsfrlm1mhob2s21peofg1t.apps.googleusercontent.com",
|
||||
"client_id": "933560802882-29olj9ku64jbe9h7flinha6hbi8qrluh.apps.googleusercontent.com",
|
||||
"client_type": 2,
|
||||
"ios_info": {
|
||||
"bundle_id": "com.krow.app.staff.dev"
|
||||
"bundle_id": "com.krowwithus.staff"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:933560802882:android:1ae05d85c865f77c7757db",
|
||||
"android_client_info": {
|
||||
"package_name": "com.krowwithus.staff"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "933560802882-grp98a1v7amflnnup68vh01tj06eaem1.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyDBYhflhK6DThKnS7RM-9raKdvyKzLUjY4"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "933560802882-grp98a1v7amflnnup68vh01tj06eaem1.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
},
|
||||
{
|
||||
"client_id": "933560802882-29olj9ku64jbe9h7flinha6hbi8qrluh.apps.googleusercontent.com",
|
||||
"client_type": 2,
|
||||
"ios_info": {
|
||||
"bundle_id": "com.krowwithus.staff"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
162
apps/mobile/apps/staff/android/app/google-services.json_back
Normal file
162
apps/mobile/apps/staff/android/app/google-services.json_back
Normal file
@@ -0,0 +1,162 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "933560802882",
|
||||
"project_id": "krow-workforce-dev",
|
||||
"storage_bucket": "krow-workforce-dev.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:933560802882:android:edcddb83ea4bbb517757db",
|
||||
"android_client_info": {
|
||||
"package_name": "com.krow.app.business.dev"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "933560802882-grp98a1v7amflnnup68vh01tj06eaem1.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyDBYhflhK6DThKnS7RM-9raKdvyKzLUjY4"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "933560802882-grp98a1v7amflnnup68vh01tj06eaem1.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
},
|
||||
{
|
||||
"client_id": "933560802882-dppsapp5i3lsfrlm1mhob2s21peofg1t.apps.googleusercontent.com",
|
||||
"client_type": 2,
|
||||
"ios_info": {
|
||||
"bundle_id": "com.krow.app.staff.dev"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:933560802882:android:d49b8c0f4d19e95e7757db",
|
||||
"android_client_info": {
|
||||
"package_name": "com.krow.app.staff.dev"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "933560802882-grp98a1v7amflnnup68vh01tj06eaem1.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyDBYhflhK6DThKnS7RM-9raKdvyKzLUjY4"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "933560802882-grp98a1v7amflnnup68vh01tj06eaem1.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
},
|
||||
{
|
||||
"client_id": "933560802882-dppsapp5i3lsfrlm1mhob2s21peofg1t.apps.googleusercontent.com",
|
||||
"client_type": 2,
|
||||
"ios_info": {
|
||||
"bundle_id": "com.krow.app.staff.dev"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:933560802882:android:da13569105659ead7757db",
|
||||
"android_client_info": {
|
||||
"package_name": "com.krowwithus.client"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "933560802882-grp98a1v7amflnnup68vh01tj06eaem1.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyDBYhflhK6DThKnS7RM-9raKdvyKzLUjY4"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "933560802882-grp98a1v7amflnnup68vh01tj06eaem1.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
},
|
||||
{
|
||||
"client_id": "933560802882-dppsapp5i3lsfrlm1mhob2s21peofg1t.apps.googleusercontent.com",
|
||||
"client_type": 2,
|
||||
"ios_info": {
|
||||
"bundle_id": "com.krow.app.staff.dev"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:933560802882:android:1ae05d85c865f77c7757db",
|
||||
"android_client_info": {
|
||||
"package_name": "com.krowwithus.staff"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "933560802882-ikdfv3o5f47g36qqgvfq55o4m19n7gk4.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.krowwithus.staff",
|
||||
"certificate_hash": "ac917ae8470ab29f1107c773c6017ff5ea5d102d"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "933560802882-grp98a1v7amflnnup68vh01tj06eaem1.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyDBYhflhK6DThKnS7RM-9raKdvyKzLUjY4"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "933560802882-grp98a1v7amflnnup68vh01tj06eaem1.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
},
|
||||
{
|
||||
"client_id": "933560802882-dppsapp5i3lsfrlm1mhob2s21peofg1t.apps.googleusercontent.com",
|
||||
"client_type": 2,
|
||||
"ios_info": {
|
||||
"bundle_id": "com.krow.app.staff.dev"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
@@ -27,6 +27,7 @@ class PhoneVerificationPage extends StatelessWidget {
|
||||
required BuildContext context,
|
||||
required String phoneNumber,
|
||||
}) {
|
||||
print('Phone verification input: "$phoneNumber" len=${phoneNumber.length}');
|
||||
if (phoneNumber.length == 10) {
|
||||
BlocProvider.of<AuthBloc>(
|
||||
context,
|
||||
|
||||
@@ -159,7 +159,7 @@ class _FormI9PageState extends State<FormI9Page> {
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: () => Modular.to.pop(),
|
||||
onPressed: () => Modular.to.pop(true),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: UiColors.primary,
|
||||
foregroundColor: UiColors.bgPopup,
|
||||
@@ -513,23 +513,23 @@ class _FormI9PageState extends State<FormI9Page> {
|
||||
_buildRadioOption(
|
||||
context,
|
||||
state,
|
||||
'citizen',
|
||||
'CITIZEN',
|
||||
'1. A citizen of the United States',
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
_buildRadioOption(
|
||||
context,
|
||||
state,
|
||||
'noncitizen_national',
|
||||
'NONCITIZEN',
|
||||
'2. A noncitizen national of the United States',
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
_buildRadioOption(
|
||||
context,
|
||||
state,
|
||||
'permanent_resident',
|
||||
'PERMANENT_RESIDENT',
|
||||
'3. A lawful permanent resident',
|
||||
child: state.citizenshipStatus == 'permanent_resident'
|
||||
child: state.citizenshipStatus == 'PERMANENT_RESIDENT'
|
||||
? Padding(
|
||||
padding: const EdgeInsets.only(top: 12),
|
||||
child: _buildTextField(
|
||||
@@ -545,9 +545,9 @@ class _FormI9PageState extends State<FormI9Page> {
|
||||
_buildRadioOption(
|
||||
context,
|
||||
state,
|
||||
'alien_authorized',
|
||||
'ALIEN',
|
||||
'4. An alien authorized to work',
|
||||
child: state.citizenshipStatus == 'alien_authorized'
|
||||
child: state.citizenshipStatus == 'ALIEN'
|
||||
? Padding(
|
||||
padding: const EdgeInsets.only(top: 12),
|
||||
child: Column(
|
||||
@@ -765,13 +765,13 @@ class _FormI9PageState extends State<FormI9Page> {
|
||||
|
||||
String _getReadableCitizenship(String status) {
|
||||
switch (status) {
|
||||
case 'citizen':
|
||||
case 'CITIZEN':
|
||||
return 'US Citizen';
|
||||
case 'noncitizen_national':
|
||||
case 'NONCITIZEN':
|
||||
return 'Noncitizen National';
|
||||
case 'permanent_resident':
|
||||
case 'PERMANENT_RESIDENT':
|
||||
return 'Permanent Resident';
|
||||
case 'alien_authorized':
|
||||
case 'ALIEN':
|
||||
return 'Alien Authorized to Work';
|
||||
default:
|
||||
return 'Unknown';
|
||||
|
||||
@@ -205,7 +205,7 @@ class _FormW4PageState extends State<FormW4Page> {
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: () => Modular.to.pop(),
|
||||
onPressed: () => Modular.to.pop(true),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: UiColors.primary,
|
||||
foregroundColor: UiColors.bgPopup,
|
||||
@@ -460,7 +460,7 @@ class _FormW4PageState extends State<FormW4Page> {
|
||||
_buildRadioOption(
|
||||
context,
|
||||
state,
|
||||
'single',
|
||||
'SINGLE',
|
||||
'Single or Married filing separately',
|
||||
null,
|
||||
),
|
||||
@@ -468,7 +468,7 @@ class _FormW4PageState extends State<FormW4Page> {
|
||||
_buildRadioOption(
|
||||
context,
|
||||
state,
|
||||
'married',
|
||||
'MARRIED',
|
||||
'Married filing jointly or Qualifying surviving spouse',
|
||||
null,
|
||||
),
|
||||
@@ -476,7 +476,7 @@ class _FormW4PageState extends State<FormW4Page> {
|
||||
_buildRadioOption(
|
||||
context,
|
||||
state,
|
||||
'head_of_household',
|
||||
'HEAD',
|
||||
'Head of household',
|
||||
'Check only if you\'re unmarried and pay more than half the costs of keeping up a home',
|
||||
),
|
||||
|
||||
@@ -75,7 +75,7 @@ class TaxFormsPage extends StatelessWidget {
|
||||
spacing: UiConstants.space6,
|
||||
children: <Widget>[
|
||||
_buildProgressOverview(state.forms),
|
||||
...state.forms.map(_buildFormCard),
|
||||
...state.forms.map((TaxForm form) => _buildFormCard(context, form)),
|
||||
_buildInfoCard(),
|
||||
],
|
||||
),
|
||||
@@ -138,16 +138,22 @@ class TaxFormsPage extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildFormCard(TaxForm form) {
|
||||
Widget _buildFormCard(BuildContext context, TaxForm form) {
|
||||
// Helper to get icon based on type (could be in entity or a mapper)
|
||||
final String icon = form is I9TaxForm ? '🛂' : '📋';
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
onTap: () async {
|
||||
if (form is I9TaxForm) {
|
||||
Modular.to.pushNamed('i9', arguments: form);
|
||||
final result = await Modular.to.pushNamed('i9', arguments: form);
|
||||
if (result == true && context.mounted) {
|
||||
BlocProvider.of<TaxFormsCubit>(context).loadTaxForms();
|
||||
}
|
||||
} else if (form is W4TaxForm) {
|
||||
Modular.to.pushNamed('w4', arguments: form);
|
||||
final result = await Modular.to.pushNamed('w4', arguments: form);
|
||||
if (result == true && context.mounted) {
|
||||
BlocProvider.of<TaxFormsCubit>(context).loadTaxForms();
|
||||
}
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
|
||||
67
backend/dataconnect/functions/clean.gql
Normal file
67
backend/dataconnect/functions/clean.gql
Normal file
@@ -0,0 +1,67 @@
|
||||
mutation unseedAll @auth(level: USER) {
|
||||
# ----------------------------------
|
||||
# Leaf/Join tables
|
||||
# ----------------------------------
|
||||
taskComment_deleteMany(all: true)
|
||||
memberTask_deleteMany(all: true)
|
||||
assignment_deleteMany(all: true)
|
||||
application_deleteMany(all: true)
|
||||
message_deleteMany(all: true)
|
||||
userConversation_deleteMany(all: true)
|
||||
conversation_deleteMany(all: true)
|
||||
activityLog_deleteMany(all: true)
|
||||
clientFeedback_deleteMany(all: true)
|
||||
recentPayment_deleteMany(all: true)
|
||||
invoice_deleteMany(all: true)
|
||||
invoiceTemplate_deleteMany(all: true)
|
||||
customRateCard_deleteMany(all: true)
|
||||
vendorRate_deleteMany(all: true)
|
||||
vendorBenefitPlan_deleteMany(all: true)
|
||||
staffCourse_deleteMany(all: true)
|
||||
staffDocument_deleteMany(all: true)
|
||||
staffRole_deleteMany(all: true)
|
||||
staffAvailability_deleteMany(all: true)
|
||||
staffAvailabilityStats_deleteMany(all: true)
|
||||
emergencyContact_deleteMany(all: true)
|
||||
taxForm_deleteMany(all: true)
|
||||
certificate_deleteMany(all: true)
|
||||
|
||||
# ----------------------------------
|
||||
# Tasks / Shifts / Orders
|
||||
# ----------------------------------
|
||||
task_deleteMany(all: true)
|
||||
shiftRole_deleteMany(all: true)
|
||||
shift_deleteMany(all: true)
|
||||
order_deleteMany(all: true)
|
||||
|
||||
# ----------------------------------
|
||||
# Teams / Hubs / Org
|
||||
# ----------------------------------
|
||||
teamMember_deleteMany(all: true)
|
||||
teamHudDepartment_deleteMany(all: true)
|
||||
team_deleteMany(all: true)
|
||||
teamHub_deleteMany(all: true)
|
||||
hub_deleteMany(all: true)
|
||||
|
||||
# ----------------------------------
|
||||
# Catalog / Config
|
||||
# ----------------------------------
|
||||
roleCategory_deleteMany(all: true)
|
||||
role_deleteMany(all: true)
|
||||
category_deleteMany(all: true)
|
||||
level_deleteMany(all: true)
|
||||
course_deleteMany(all: true)
|
||||
faqData_deleteMany(all: true)
|
||||
benefitsData_deleteMany(all: true)
|
||||
attireOption_deleteMany(all: true)
|
||||
document_deleteMany(all: true)
|
||||
|
||||
# ----------------------------------
|
||||
# Core entities
|
||||
# ----------------------------------
|
||||
staff_deleteMany(all: true)
|
||||
vendor_deleteMany(all: true)
|
||||
business_deleteMany(all: true)
|
||||
account_deleteMany(all: true)
|
||||
user_deleteMany(all: true)
|
||||
}
|
||||
1726
backend/dataconnect/functions/seed.gql
Normal file
1726
backend/dataconnect/functions/seed.gql
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
# --- Data Connect / Backend ---
|
||||
|
||||
.PHONY: dataconnect-enable-apis dataconnect-init dataconnect-deploy dataconnect-sql-migrate dataconnect-generate-sdk dataconnect-sync dataconnect-bootstrap-db check-gcloud-beta
|
||||
.PHONY: dataconnect-enable-apis dataconnect-init dataconnect-deploy dataconnect-sql-migrate dataconnect-generate-sdk dataconnect-sync dataconnect-bootstrap-db check-gcloud-beta dataconnect-clean
|
||||
|
||||
# Enable all required APIs for Firebase Data Connect + Cloud SQL
|
||||
dataconnect-enable-apis:
|
||||
@@ -50,9 +50,16 @@ dataconnect-sync:
|
||||
# Execute seed in Firebase Data Connect
|
||||
dataconnect-seed:
|
||||
@echo "--> Exec seed in Firebase Data Connect..."
|
||||
@firebase dataconnect:execute seeds/seed_min.graphql --project=$(FIREBASE_ALIAS)
|
||||
@firebase dataconnect:execute backend/dataconnect/functions/seed.gql --project=$(FIREBASE_ALIAS)
|
||||
@echo "✅ Seed executed successfully."
|
||||
|
||||
|
||||
# Execute clean, to delete all the data in Firebase Data Connect
|
||||
dataconnect-clean:
|
||||
@echo "--> Exec clean all the data in Firebase Data Connect..."
|
||||
@firebase dataconnect:execute backend/dataconnect/functions/clean.gql --project=$(FIREBASE_ALIAS)
|
||||
@echo "✅ Clean information executed successfully."
|
||||
|
||||
# Run tests for Data Connect deployment and migrations
|
||||
dataconnect-test:
|
||||
@echo "--> Running Data Connect tests..."
|
||||
|
||||
Reference in New Issue
Block a user